n_str=input()
n_lst=n_str.split(',')

flag=False
for i in range(10,100):
    if i%3==int(n_lst[0]) and i%5==int(n_lst[1]) and i%7==int(n_lst[2]):
        print(i)
        flag=True
        break

if flag==False:
    print('No answer')
